package com.zy.cat.entity.dev;


import java.util.UUID;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.Table;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.RequiredArgsConstructor;

/**
 * 
 * @info 9趣猫用户果园详细信息实体类
 * @author Link
 * @date 2019-10-30 08:56
 */
@Entity
@Table(name = "zy_cat_tree_task_record",
indexes = {
		@Index(name = "id", columnList = "id"),
		@Index(name = "pid", columnList = "pid"), 
		@Index(name = "taskType", columnList = "task_type"), 
		@Index(name = "taskStatus", columnList = "task_status"), 
		@Index(name = "receiveStatus", columnList = "receive_status"), 
		@Index(name = "ctime", columnList = "ctime") })
@Data
@RequiredArgsConstructor
@ApiModel("用户果园任务完成记录表")
public class CatDevTreeTaskRecord{


	@Id
	@Column(columnDefinition = "CHAR(32) DEFAULT '-'  COMMENT '任务ID'")
	@ApiModelProperty(value = "任务ID", example = "0")
    private String id=UUID.randomUUID().toString().replace("-", "");
	
	@Column(name = "task_type",columnDefinition = "INT(2) DEFAULT '0' COMMENT '新人任务类型（0.新用户首次奖励、1.新手教程、2.完善手机号、3.绑定公众号、4.新人首单）'")
	@ApiModelProperty(value = "新人任务类型（0.新用户首次奖励、1.新手教程、2.完善手机号、3.绑定公众号、4.新人首单）", example = "0")
    private int taskType;
	
	@Column(columnDefinition = "VARCHAR(20) NOT NULL COMMENT '9趣猫用户ID'")
	@ApiModelProperty(value = "9趣猫用户ID", example = "18986866666")
    private String pid="";
	
	@Column(name = "fertilizer_num",columnDefinition = "INT(10) DEFAULT '0' COMMENT '肥料数量'")
	@ApiModelProperty(value = "肥料数量", example = "6")
	private int fertilizerNum;
	
	@Column(name = "task_status",columnDefinition = "INT(2) DEFAULT '0' COMMENT '任务完成状态(0.未完成、1.已完成)'")
	@ApiModelProperty(value = "任务完成状态(-1.已取消、0.未完成、1.已完成)", example = "0")
	private int taskStatus;
	
	@Column(name = "receive_status",columnDefinition = "INT(2) DEFAULT '0' COMMENT '任务奖励领取状态(-1.无法领取、0.待领取、1.已领取)'")
	@ApiModelProperty(value = "任务奖励领取状态(-1.无法领取、0.待领取、1.已领取)", example = "0")
	private int receiveStatus;
	
	@Column(name = "task_attribute",columnDefinition = "INT(2) DEFAULT '0' COMMENT '任务属性(0.新人任务、1.每日任务)'")
	@ApiModelProperty(value = "任务属性(0.新人任务、1.每日任务)", example = "0")
	private int taskAttribute;
	
	@Column(name = "task_num",columnDefinition = "INT(10) DEFAULT '0' COMMENT '任务完成次数'")
	@ApiModelProperty(value = "任务完成次数", example = "1")
	private int taskNum;
	

	@Column(columnDefinition = "VARCHAR(20) DEFAULT '-'  COMMENT '创建时间'")
	@ApiModelProperty(value = "创建时间", example = "2019-02-22")
	private String ctime="-";
	
	@Column(columnDefinition = "VARCHAR(20) DEFAULT '-'  COMMENT '最后修改时间'")
	@ApiModelProperty(value = "最后修改时间", example = "2019-02-22 12:56:56")
	private String ltime="-";
	
	@ApiModelProperty(value = "任务总次数", example = "0")
	private Integer taskTotal;

	@ApiModelProperty(value = "任务标题", example = "")
	private String taskTitle;
	
	@ApiModelProperty(value = "任务内容", example = "")
	private String taskContent;
	
	@Column(name = "task_pic",columnDefinition = "VARCHAR(200) DEFAULT NULL COMMENT '任务图标'")
	@ApiModelProperty(value = "任务图标", example = "https://")
	private String taskPic;
	
	@Column(name = "task_btn",columnDefinition = "VARCHAR(200) DEFAULT NULL COMMENT '任务按钮'")
	@ApiModelProperty(value = "任务按钮", example = "")
	private String taskBtn;
	
	@Column(name = "is_show",columnDefinition = "INT(10) DEFAULT '0' COMMENT '是否展示(0.不展示、1.展示)'")
	@ApiModelProperty(value = "是否展示(0.不展示、1.展示)", example = "0")
	private int isShow=1;
	
	public CatDevTreeTaskRecord(int taskType, String pid, int fertilizerNum,String ctime,int taskAttribute,
			String taskContent,Integer taskNum,String taskTitle,String taskPic,String taskBtn) {
		super();
		this.taskType = taskType;
		this.pid = pid;
		this.fertilizerNum=fertilizerNum;
		this.ctime = ctime;
		this.taskAttribute=taskAttribute;
		this.taskContent=taskContent;
		this.taskTotal=taskNum;
		this.taskTitle=taskTitle;
		this.taskPic=taskPic;
		this.taskBtn=taskBtn;
	}

	public CatDevTreeTaskRecord(String pid,int taskType) {
		super();
		this.pid = pid;
		this.taskType=taskType;
	}
}
